#!perl -T

use Test::More tests => 4;

use Getopt::CommandLineExports qw(:ALL);

%cmdLines = (
    oneList         => [qw/ ONE=s@ /],
);

sub oneList
{
    my %h = (
        ONE => undef,
        ( parseArgs \@_, @{$cmdLines{oneList}}),
    );
    print "oneList missing required argument:\n"
        . join( "\n", checkArgs \%h ) . "\n"
        if ( checkArgs \%h );
    return join(",",@{$h{ONE}});
}


like( (oneList "Hello1,Hello2"), qr/Hello1.*Hello2/, 'Pass list by position');
like( (oneList {ONE => ["Hello1", "Hello2"]}), qr/Hello1.*Hello2/, 'Pass list by Name in hash');
like( (oneList "--ONE Hello1 --ONE Hello2") , qr/Hello1.*Hello2/, 'Pass list by Command Line String');
like( (oneList "--ONE", "Hello1", "--ONE", "Hello2") , qr/Hello1.*Hello2/, 'Pass list by Command Line ARGV String list');
#like( (oneList "--ONE", "Hello1", "--ONE", "Hello2", "--THREE", "Hello3"), qr/Hello1.*Hello2/, 'Pass list by Command Line ARGV String list with an unknown parameter');

